package lab02.test06;

/**
 * Created by Jammy on 2017/10/15.
 */
public class Triangle {
    double a;
    double b;
    double c;
    double area;

    public boolean triangle;


    //2.行为
    double length(){
        return a + b + c;
    }
    double area(){
        double s=(a+b+c)/2;
        area =Math.sqrt(s*(s-a)*(s-b)*(s-c));
        return area;
    }

    void revise(double a,double b,double c){
        this.a = a;
        this.b = b;
        this.c = c;
    }
    boolean triangle(){
        if((a + b > c ) && ((a - b) )< c){
            return true;
        }else
            return false;
    }

    public Triangle(){}

    public Triangle(double a, double b, double c) {
        this.a =a;
        this.b = b;
        this.c = c;
    }

    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }

    @Override
    public String toString() {
        return "周长："+length()+"面积："+area();
    }
}

